const CracoLessPlugin = require("craco-less");
const px2rem = require("postcss-px2rem-exclude");
module.exports = {
	//rem配置
	style: {
		postcss: {
			loaderOptions: {
				ident: "postcss",
				plugins: () => [
					px2rem({
						remUnit: 37.5, //基准值
						exclude: /node_modules/i,
					}),
				],
			},
		},
	},
	// less 配置
	plugins: [
		{
			plugin: CracoLessPlugin,
			options: {
				lessLoaderOptions: {
					lessOptions: {
						// modifyVars: { '@brand-primary': '#1DA57A' },建议主题色在less中更改比较方便
						javascriptEnabled: true,
					},
				},
			},
		},
	]
};